package cn.fan.rabbitMQ.snnd;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class EmailMQSend {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void sendEmail(long id){
        String exchange="msg.direct";
        String key = "msg";
        rabbitTemplate.convertAndSend(exchange,key,id);
    }
}
